SceneEditor.prototype.showOrHideProvider=function(layerId,state,type){
	var _this=this;
	if('Maps'==type){
		layer.load(2);
	    _this.ajaxFunc(_this.ctx+"/scene/map/getList",{
	    	sceneId:_this.sceneId,
	    	layerId:layerId
	    }, "json", function(res){
	    	layer.closeAll('loading');
			 if (undefined!=res && 200==res.code) {
				 var list=res.data;
				 if(state==true){
					 _this.globe.addProviders(list);
				 }else{
					 _this.globe.removeProviders(list);
				 }
			 }
			 else{
				 layer.alert(res.message, {icon: 3,skin: 'layer-ext-moon' })
			 }
	    });
	}else if('Map'==type){
		layer.load(2);
	    _this.ajaxFunc(_this.ctx+"/scene/map/getById",{
	    	id:layerId
	    }, "json", function(res){
	    	layer.closeAll('loading');
			 if (undefined!=res && 200==res.code) {
				 var model=res.data; 
				 if(model){
					 if(state==true){
						 _this.globe.addProvider(model);
					 }else{
						 _this.globe.removeProvider(model.id);
					 }
				 }
			 }
			 else{
				 layer.alert(res.message, {icon: 3,skin: 'layer-ext-moon' })
			 }
	    });
	}else{
		layer.alert('未识别图层标识【"'+type+'"】！！', {icon: 1,skin: 'layer-ext-moon' })
	}
} 

/**
 * 在线底图
 */
SceneEditor.prototype.addOnLineProvider=function(node){
	 var _this=this;
	 layer.load(2);
	 _this._Ajax('get',_this.ctx+"/scene/map/select",{sceneId:_this.sceneId,layerId:node.id},'html',function(e){
		layer.closeAll('loading');
	    layer.open({
	    	id:'bizMapLayer',
	        title:'在线底图',
	        type: 1,
	        area: '288px',
	        content:e,
	        shade:0,
	        offset: ['0px', '224px'],
	        fixed:true,
	        move:false,
	        skin:'layui-layer layui-layer-adminRight layui-layer-city',
		    content: e,
		    success: function (layero, dIndex) {
	            $(layero).children('.layui-layer-content').css('overflow', 'hidden');
	            $(".map-ul li").bind('click',function(e){
	            	var formData={}; 
	            	var id=$(e.currentTarget).attr("id");
	            	var type=$(e.currentTarget).attr("type");
	            	if($(e.currentTarget).hasClass("map-selected")){
		        	    layer.load(2);
		                _this.ajaxFunc(_this.ctx+"/scene/map/delete",{mapId:id,layerId:node.id}, "json", function(res){
			                layer.closeAll('loading');
			                if (200==res.code) {
			                    layer.msg(res.message);
			                } else {
			                    layer.msg(res.message);
			                }
		                });
	            	}else{
		            	formData['bizSceneMap.id']=id;
		            	formData['bizSceneMap.mapId']=id;
		            	formData['bizSceneMap.sceneId']=_this.sceneId;
		            	formData['bizSceneMap.layerId']=node.id;
		        	    layer.load(2);
		                _this.ajaxFunc(_this.ctx+"/scene/map/save",formData, "json", function(res){
			                layer.closeAll('loading');
			                if (200==res.code) {
			                    layer.msg(res.message);
			                    _this.reAsyncLayerByPId(res.data.layerId);
			                } else {
			                    layer.msg(res.message);
			                }
		                });
	            	}
	            	$(e.currentTarget).toggleClass("map-selected");
	            })
			},
			end:function(){
			}
	    });  
	});
}

SceneEditor.prototype.editProvider = function(node) {
	var _this=this;
	 layer.load(2);
	 _this._Ajax('get',_this.ctx+"/scene/map/setting",{mapId:node.id},'html',function(e){
		layer.closeAll();
		layer.open({
		   id:'editProvider',
           type: 1,
           anim:5,
           title:'底图设置',
           area: '300px',
           content:e,
           shade:0,
           offset: ['0px', '224px'],	
           fixed:true,
           move:false,
		    skin:'layui-layer  layui-layer-adminRight layui-layer-city',
           success: function (layero, dIndex) {
              $(layero).children('.layui-layer-content').css('overflow', 'hidden');
              form.render();
              form.on('submit(submitBaseBizSceneMapMapForm)', function (data) {
	        	    layer.load(2);
	                var formData={}; 
	                for(var key in data.field){
	                	formData['bizSceneMap.'+key]=data.field[key];
	                }
	                _this.ajaxFunc(_this.ctx+"/scene/map/save",formData, "json", function(res){
		                layer.closeAll('loading');
		                if (200==res.code) {
		                    layer.msg(res.message, {icon: 1});
		                    _this.reAsyncLayerByPId(res.data.layerId);
		                } else {
		                    layer.msg(res.message, {icon: 2});
		                }
	                });
	        	    return false;
	        	});
			},
			end:function(){
			}
		});	
	});
}


